#include "font_dialog.h"
FontDialog::FontDialog(QWidget *parent)
    : QDialog(parent){
    this->setWindowTitle("标准字体对话框");
    fontBtn =new QPushButton("选择");
    font_LineEdit =new QLineEdit();
    font_LineEdit->setText("字体演示"); // 用于查看字体样式
    connect(fontBtn, SIGNAL(clicked()), this, SLOT(selectFont()));

    mainlayout =new QGridLayout(this);
    mainlayout->addWidget(fontBtn,0,0);
    mainlayout->addWidget(font_LineEdit,0,1);
}
FontDialog::~FontDialog()
{

}

void FontDialog::selectFont() {
    bool ok;
    QFont font= QFontDialog::getFont(&ok);
    if(ok){
        this->font_LineEdit->setFont(font);
    }
}